package com.wj.taobaoke.nvzhuang;

import com.wj.taobaoke.GenerateBlogFile;
import com.wj.taobaoke.GuanJianZi;
import com.wj.taobaoke.ReadTemplate;

public class GenerateNvZhuangBlogFile{

	public static void main(String[] args) {
		

		String templateFileName = "nvzhuangTemplate.html";
		ReadTemplate readTemplate = new ReadTemplate();
		readTemplate.readTemplateList(templateFileName);
		GenerateBlogFile generateBlogFile = new GenerateBlogFile(readTemplate);
		generateBlogFile.createIndexHtmlFile(NvZhuangGuanJianZi.XinKuanNvZhuang());
		generateBlogFile.createIndexHtmlFile(NvZhuangGuanJianZi.ShiShangNvZhuang());
		generateBlogFile.createIndexHtmlFile(NvZhuangGuanJianZi.MengBaShaNvZhuang());
		generateBlogFile.createIndexHtmlFile(NvZhuangGuanJianZi.MaiKaoLinNvZhuang());
		GenerateBlogFile.executor.shutdown();
		try {
			while(GenerateBlogFile.executor.getPoolSize() != 0){
				Thread.sleep(GenerateBlogFile.executor.getPoolSize() * 1000);
				System.out.println("size=="+GenerateBlogFile.executor.getPoolSize());
				if(GenerateBlogFile.allItemList.size() > 0){
					System.out.println(GenerateBlogFile.allItemList.get(0).index+"_"+GenerateBlogFile.allItemList.get(0).contentUrl);
				}
			}
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println("ok");
	}

}
